#include <stdio.h>
#include <stdlib.h>
void sort(int **s, int n) {
    int i, j;
    for (i = 0; i < n; i++) {
        for (j = i + 1; j < n; j++) {
            if (**(s + i) > **(s + j)) {
                int *temp = *(s + i);
                *(s + i) = *(s + j);
                *(s + j) = temp;
            }
        }
    }
}
int main() {
    int n;
    printf("Enter the number of numbers: ");
    scanf("%d", &n);
    int **s = (int **)malloc(n * sizeof(int *));
    if (s == NULL) {
        printf("Memory allocation failed");
        return 1;
    } else {
        for (int i = 0; i < n; i++) {
            s[i] = (int *)malloc(sizeof(int));
            if (s[i] == NULL) {
                printf("Memory allocation failed");
                return 1;
            }
            scanf("%d", s[i]);
        }
    }
    sort(s, n);
    for (int i = 0; i < n; i++) {
        printf("%d ", **(s + i));
    }
    printf("\n");
    for (int i = 0; i < n; i++) {
        free(s[i]);
    }
    free(s);

    return 0;
}